#include <iostream>
#include <vector>
using namespace std;
vector<vector<char> > a;
vector<vector<bool> > b;

bool In(int x, int y){
    return x>=1 && x<=10 && y>=1 && y<=10;
}

bool InG(int x, int y){
    return x>=1 && x<=3 && y>=4 && y<=6;
}

void go(char f, int d, int x, int y){
    do{
        if(f == 'x') x+=d; else y+=d;
        if(In(x, y)) b[x][y] = false;
    }while(In(x, y) && !a[x][y]);
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    int n, bx, by;
    while(cin >> n >> bx >> by){
        bool fei = false;
        if(bx == 0 && by == 0 && n == 0) return 0;
        else{
            a.assign(11, vector<char>(11, 0));
            b.assign(11, vector<bool>(11, true));
            while(n--){
                char ch; int x, y;
                cin >> ch >> x >> y;
                a[x][y] = ch;
            }
            for (int r = 1; r < 11; ++r) {
                for (int c = 1; c < 11; ++c) {
                    int x = r, y = c;
                    switch(a[r][c]){
                        case 'G':{
                            do{
                                --x;
                                if(In(x, y)) b[x][y] = false;
                                if(x == bx && y==by) {fei = true; break;}
                            }while(In(x, y) && !a[x][y]);
                            break;
                        }
                        case 'R':{
                            go('x', 1, r, c);
                            go('x', -1, r, c);
                            go('y', 1, r, c);
                            go('y', -1, r, c);
                            break;
                        }
                        case 'H':{
                            if(In(x-1, y) && !a[x-1][y]){
                                if(In(x-2, y+1)) b[x-2][y+1] = false;
                                if(In(x-2, y-1)) b[x-2][y-1] = false;
                            }
                            if(In(x+1, y) && !a[x+1][y]){
                                if(In(x+2, y+1)) b[x+2][y+1] = false;
                                if(In(x+2, y-1)) b[x+2][y-1] = false;
                            }
                            if(In(x, y+1) && !a[x][y+1]){
                                if(In(x+1, y+2)) b[x+1][y+2] = false;
                                if(In(x-1, y+2)) b[x-1][y+2] = false;
                            }
                            if(In(x, y-1) && !a[x][y-1]){
                                if(In(x+1, y-2)) b[x+1][y-2] = false;
                                if(In(x-1, y-2)) b[x-1][y-2] = false;
                            }
                            break;
                        }
                        case 'C':{
                            x = r, y = c; while(In(--x, y) && !a[x][y]);
                            if(In(x, y)) go('x', -1, x, y);
                            x = r, y = c; while(In(++x, y) && !a[x][y]);
                            if(In(x, y)) go('x', 1, x, y);
                            x = r, y = c; while(In(x, ++y) && !a[x][y]);
                            if(In(x, y)) go('y', 1, x, y);
                            x = r, y = c; while(In(x, --y) && !a[x][y]);
                            if(In(x, y)) go('y', -1, x, y);
                            break;
                        }
                        default: break;
                    }
                }
            }
            if(
                fei ||
                (InG(bx+1, by) && b[bx+1][by]) ||
                (InG(bx-1, by) && b[bx-1][by]) ||
                (InG(bx, by+1) && b[bx][by+1]) ||
                (InG(bx, by-1) && b[bx][by-1])
                ) cout << "NO\n";
            else cout << "YES\n";
        }
    }

    return 0;
}




